package cn.suimg.shortlink.redis;

/**
 * Cache Key
 * 存储Redis Key
 */
public class CacheKeys {

    /**
     * 短链接缓存
     */
    public static final CacheKeys SHORT_LINK_CACHE = new CacheKeys("short_link_cache:",0);


    private String key;

    private int db;

    private CacheKeys(String key, int db) {
        this.key = key;
        this.db = db;
    }

    public static CacheKeys keyLink(CacheKeys cacheKeys, Object linkStr) {
        return new CacheKeys(cacheKeys.getKey() + linkStr.toString() , cacheKeys.getDb());
    }

    String getKey() {
        return key;
    }

    int getDb() {
        return db;
    }
}
